"""
@File    : Manage.py
@Time    : 2019/8/13 16:59
@Author  : LiuFeiYu
@Email   : liufeiyu@sunrise.net
@Software: PyCharm
"""

from flask import Flask
from flask import render_template
import os

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/all_html_name', methods=['GET', 'POST'])
def get_all_html():
    """
    返回所有报告目录的文件夹名称
    :return:
    """
    res = os.listdir(os.path.dirname(os.path.realpath(__file__)) + r'\Report\html')
    new_res_list = ['请选择,']
    for i in res:
        new_res_list.append(i + ',')
    new_res = ' '.join(new_res_list)
    return new_res


if __name__ == '__main__':
    app.run(debug=True)  # 设置debug=True是为了让代码修改实时生效，而不用每次重启加载
